1. Field of the Invention
The present invention relates, in general, to an image compression method, and, more particularly, to a high-speed motion compensation apparatus and method in an image compression method.
2. Description of the Related Art
H.264/Advanced Video Coding (AVC) image compression is the most recently standardized image compression method, and utilizes various techniques to improve the compressibility of images. Among the techniques, a motion compensation technique is one of the principal techniques of H.264/AVC image compression, and is configured such that the region most similar to a certain region in a current frame is found in a previous frame, and only the difference between the regions and the relative location of the found region are transmitted, and thus the current frame is recovered. Therefore, when the motion compensation technique is used, information much smaller in the case where all pixel information of the current frame is transmitted can be transmitted, and thus the current frame can be recovered.
Generally, in order to generate sub-pixels, a number of reference pixels greater than the number of sub-pixels is required. However, since, typically, a large number of reference pixels overlaps each other, a method of retrieving overlapping reference pixels from reference frames every time, as in the case of conventional motion compensation, is inefficient because it takes a lot of time and power consumption is high. Further, since reference pixels, required to generate sub-pixels, are not efficiently distributed in word addresses, it is inefficient to retrieve words without aligning reference pixels, as in the case of conventional motion compensation.
FIGS. 1A and 1B are diagrams showing reference pixels based on the partitioning of sub-macroblocks.
FIG. 1A illustrates four sub-macroblocks 10a, each composed of 4×4 sub-pixels, and a reference frame 20a required to generate the sub-macroblocks 10a, and FIG. 1B illustrates two sub-macroblocks 10b, each composed of 4×4 sub-pixels and a reference frame 20b required to generate the sub-macroblocks 10b. In this case, shaded regions 30a and 30b indicate reference pixels that overlap each other in the reference frames 20a and 20b, required to generate the sub-macroblocks 10a and 10b, each composed of 4×4 sub-pixels, and white regions 40a and 40b indicate reference pixels that do not overlap each other. Therefore, it is inefficient with respect to both time and power to retrieve the shaded regions 30a and 30b, that is, reference pixels overlapping each other in motion compensation, from the reference frames 20a and 20b at each time.
FIGS. 2A and 2B are diagrams showing reference pixels distributed in word addresses.
Referring to FIGS. 2A and 2B, each of small rectangles 60a and 60b indicates a single pixel, and four small rectangles 50a or 50b indicate a single word address. Shaded regions 70a and 70b indicate reference pixels, which are required for motion compensation, and white regions 80a and 80b indicate reference pixels, which are not required for motion compensation.
Typically, a single pixel is represented by 8 bits, and respective pixels are stored in memory. Therefore, when a 32-bit word address is used, four pixels are stored in a single word address. In this case, when only one of the required reference pixels is included in a single word address at the time of motion compensation, the remaining three unnecessary reference pixels must be read together with the necessary reference pixel in order to read the one reference pixel. For example, in FIG. 2A, since reference pixels 70a required for motion compensation are efficiently distributed in word addresses, all reference pixels 70a required for motion compensation can be read if only four words 65a are retrieved. In contrast, in FIG. 2B, since required reference pixels 70b are distributed over eight word addresses, all reference pixels 70b required for motion compensation can be read only when eight words 65b are retrieved. However, in general, since reference pixels required for motion compensation are not necessarily efficiently distributed in word addresses, as shown in FIG. 2A, it takes a lot of time and power to perform motion compensation.
Accordingly, there is a need to improve the performance of motion compensation by efficiently managing overlapping reference pixels and efficiently aligning reference pixels distributed in word addresses.